@using Omu.Awesome.Core
@using Rail.Net.Core.Model
@model IPageable<PriceDistance>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table class="dataTable">
    <thead>
        <tr>
            <th></th>
            <th>
                TarifNumber
            </th>
            <th>
                Class
            </th>
            <th>
                ZoneFrom
            </th>
            <th>
                ZoneTo
            </th>
            <th>
                Price
            </th>
            <th>
                ValidFrom
            </th>
            <th>
                ValidTo
            </th>
            <th>
                Ru
            </th>
        </tr>
    </thead>
    <tbody>
    @foreach (var item in Model.Page) {
        <tr>
            <td>
                @Html.ActionLink("Edit", "Edit", new { id=item.Id }) |
                @Html.ActionLink("Details", "Details", new { id=item.Id }) |
                @Html.ActionLink("Delete", "Delete", new { id=item.Id })
            </td>
            <td>
			    @item.TarifNumber
            </td>
            <td>
			    @item.Class
            </td>
            <td>
			    @item.ZoneFrom
            </td>
            <td>
			    @item.ZoneTo
            </td>
            <td>
			    @String.Format("{0:F}", item.Price)
            </td>
            <td>
			    @String.Format("{0:g}", item.ValidFrom)
            </td>
            <td>
			    @String.Format("{0:g}", item.ValidTo)
            </td>
            <td>
			    @(item.Ru == null ? "None" : item.Ru.Code)
            </td>
        </tr>
    }
    </tbody>

</table>


